package org.chen.client.fallback;

import lombok.extern.slf4j.Slf4j;
import org.chen.common.domain.R;
import org.chen.client.CategoryFeignClient;
import org.chen.domain.dto.CategoryDTO;
import org.chen.domain.vo.CategoryVO;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class CategoryFeignFallback implements CategoryFeignClient {

    @Override
    public R<List<CategoryVO>> getCategoryTree(String type) {
        log.error("获取分类树List失败，type: {}", type);
        return R.error("获取分类树List失败");
    }

    @Override
    public R<CategoryVO> getCategory(String id) {
        log.error("获取单个分类树失败，id: {}", id);
        return R.error("获取单个分类树失败");
    }

    @Override
    public R<List<CategoryVO>> getCategoriesByIds(List<String> ids) {
        log.error("获取分类树ids失败，ids: {}", ids);
        return R.error("获取单个分类树失败");
    }

    @Override
    public R<Void> addCategory(CategoryDTO dto) {
        log.error("添加分类树失败，dto: {}", dto.getId());
        return R.error("添加分类树失败");
    }

    @Override
    public R<List<CategoryVO>> getChildren(String id) {
        log.error("获取分类树Children失败，id: {}", id);
        return R.error("获取分类树Children失败");
    }
}
